<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/base.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>直播课程课时列表</title>
    <link rel="stylesheet" href="${ctximg}/static/common/ztree/css/demo.css?v=${v}" type="text/css" />
<script type="text/javascript">

	//删除课程
	function delCourse(id){
		if(confirm("是否删除?")){
            $.ajax({
                url : "${ctx}/admin/course/live/kpoint/del/" + id,
                type : "post",
                async : false,
                success : function(data) {
                    if (data.success == true) {
                        alert("删除成功");
                        window.location.href='${ctx}/admin/course/live/kpoint/list/' + $("#courseId").val();
                    } else {
                        alert("删除失败");
                    }
                }
            });
		}
	}
</script>
</head>
<body >
			<!-- 内容 开始  -->
            <div class="page_head">
                <h4><em class="icon14 i_01"></em>&nbsp;<span>直播课时管理</span> &gt; <span>课时安排列表</span> </h4>
            </div>
            <!-- /tab1 begin-->
            <div class="mt20">
                <div class="commonWrap">
                        <input type="hidden" id="courseId" name="courseId" value="${courseId}"/>
						<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTab01">
                            <caption>
                                <%-- <div class="capHead">

                                    <div class="w50pre fl">
                                        <ul class="ddBar">
                                            <li><span class="ddTitle"><font>课程id：</font></span><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="queryCourse.id" value="${course.id}" id="id" /></li>
                                            <li><span class="ddTitle"><font>课程名称：</font></span><input type="text" name="queryCourse.name" value="${course.name}" id="name" /></li>
											<li>
                                                <span class="ddTitle"><font>销售形式：</font></span>
                                                <select name="queryCourse.sellType" id="sellType">
													<option value="">--请选择--</option>
                                                    <option value="COURSE">课程</option>
                                                    <option value="PACKAGE">套餐</option>
                                                    <option value="LIVE">直播</option>
												</select>
                                            </li>
										</ul>
                                    </div>

                                    <div class="w50pre fl">
                                        <ul class="ddBar">
                                            <li>
                                                <span class="ddTitle"><font>专业：</font></span>
                                                <input id="subjectNameBtn" type="text" readonly="readonly" value="" style="width:200px;" onclick="showSubjectMenu()"/>
                                                <div id="subjectmenuContent" class="menuContent" style="display:none; position: absolute;">
                                                    <ul id="subject_ztreedemo" class="ztree" style="margin-top:0; width:200px;"></ul>
                                                </div>
                                            </li>

                                            <li>
                                                <span class="ddTitle"><font>状态：</font></span>
                                                <select name="queryCourse.isavaliable" id="isavaliable" >
                                                    <option value="-1">请选择</option>
                                                    <option value="0">上架</option>
                                                    <option value="1">下架</option>
                                                </select>
                                            </li>
                                            <li>
                                                <span class="ddTitle"><font>会员类型：</font></span>
                                                <select name="queryCourse.membertype" id="membertype">
                                                    <option value="0">--请选择--</option>
                                                    <c:forEach items="${memberTypes }" var="memberType">
                                                        <option value="${memberType.id }" <c:if test="${memberType.id==queryCourse.membertype }">selected="selected"</c:if>>${memberType.title }</option>
                                                    </c:forEach>
                                                </select>
                                            </li>
                                        </ul>
                                    </div>
                                     <div   align="center">
                                        <input type="button" name="" value="查询" class="btn btn-danger" onclick="submitSearch()">
                                        <input type="button" name="" value="清空" class="btn btn-danger" onclick="submitclear()">
                                    </div>

                                    <div class="clearfix"></div>
                                </div>--%>
                                <div class="mt10 clearfix">
                                    <p class="fl czBtn">
                                        <span>
                                            <a href="${ctx}/admin/course/live/kpoint/toadd?courseId=${courseId}" title="新建">
                                                <em class="icon14 new">&nbsp;</em>
                                                新建课时安排
                                            </a>
                                        </span>
                                    </p>
                                </div>
                            </caption>

                            <thead>
                                <tr>
                                    <th width="8%">
                                        <span>ID</span>
                                    </th>
                                    <th>
                                        <span>课时名称</span>
                                    </th>
                                    <th>
                                        <span>课时状态</span>
                                    </th>
                                    <th>
                                        <span>开始时间</span>
                                    </th>
                                    <th>
                                        <span>结束时间</span>
                                    </th>
                                    <th>
                                        <span>操作</span>
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="tabS_02" align="center">
                                <c:if test="${courseLiveKpoints.size()>0}">
                                    <c:forEach items="${courseLiveKpoints}" var="cou">
                                        <tr id="rem${cou.id }">
                                            <td>${cou.id}</td>
                                            <td>${cou.kpointName }</td>
                                            <td>
                                                <c:if test="${cou.kpointBeginTimeNum == 0 && cou.kpointEndTimeNum == 0}">已结束</c:if>
                                                <c:if test="${cou.kpointBeginTimeNum == 0 && cou.kpointEndTimeNum != 0}">进行中</c:if>
                                                <c:if test="${cou.kpointBeginTimeNum != 0 && cou.kpointEndTimeNum != 0}">未开始</c:if>
                                            </td>
                                            <td>
                                                <fmt:formatDate type="both" value="${cou.beginTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                            </td>
                                            <td>
                                                <fmt:formatDate type="both" value="${cou.endTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                            </td>
                                            <td class="c_666 czBtn" align="center">
                                                <a class="ml10 btn smallbtn btn-y" title="修改" href="${ctx}/admin/course/live/kpoint/toupdate/${cou.id}">修改</a>
                                                <a class="ml10 btn smallbtn btn-y" title="删除" href="javascript:void(0)" onclick="delCourse(${cou.id})">删除</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                </c:if>
                                <c:if test="${courseLiveKpoints.size()==0||courseLiveKpoints==null}">
                                    <tr>
                                        <td align="center" colspan="16">
                                            <div class="tips">
                                                <span>还没有相关数据！</span>
                                            </div>
                                        </td>
                                    </tr>
                                </c:if>
                            </tbody>
                        </table>
                </div>
            </div>

</body>
</html>
